package com.liwy3.lark;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Copyright © 元气森林（北京）食品科技集团有限公司. All rights reserved.
 *
 * @Description:
 * @author: Crazy4J
 * @date: 2021年11月23日 11:18
 * @version: V1.0
 */
public class LarkTest {
    public static void main(String[] args) {
        testMsg();
//        testExcel();

    }

    public static void testMsg(){
        String  hook= "https://open.feishu.cn/open-apis/bot/v2/hook/eba84819-933d-4baf-a6a5-084912d70136";
        int i=0;
        while(true){
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            i++;
            LarkMsgBot larkMsgBot = new LarkMsgBot(hook).setThreshold(30);
            larkMsgBot.send("闪电侠测试告警","我错了!" + i);

        }

    }
    public  static void testExcel(){
        LarkExcel larkExcel = new LarkExcel();
        String appAccessToken = larkExcel.getAppAccessToken("cli_a0d9e903f7b89014", "Bc8HjK3M27GG4aGapyc6EfPUOyfNrTtj");
        List<List<String>> list = larkExcel.getExcelValueList(appAccessToken, "shtcnFicWAwTtTHLzf35d9ldx7b", "gHkLxX", "A2", "E");
        System.out.println(list);
    }

}
